fix: install script TTY handling on Unix#1032
Conversation
|
Claude review from my end here, it sounds pretty fine, I would include it in v1.3, but please take a look at those points. |
2a74122 to
ca9351f
Compare
ca9351f to
2a74122
Compare
There was a problem hiding this comment.
@vladfrangu This is legit, I think only 1. and 2. form @B4nan review are worth to take a look.
also I am testing locally in docker (cat scripts/install/dev-test-install.sh | bash) and I am not sure what should be actual outcome if Y.
Should I manually run bash or you were able to bypass this and apify should be available right after install?
|
Well, even if you type |
There was a problem hiding this comment.
Pull request overview
This PR improves the Apify CLI bundled installer flow on Unix when executed via curl | bash, by avoiding Inquirer hangs and improving PATH/shell integration.
Changes:
- Add
APIFY_OPEN_TTY-based/dev/ttyprompting path that bypasses Inquirer and supports raw-mode single-keypress input. - Add shell detection + shell config file resolution helpers, and skip shell integration if
apify/actorare already on PATH. - Update bundle build script to use Bun’s
build()API and force-bundleproxy-agent; add a local dev install test script.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/utils.ts | Adds shell detection + shell config path resolution; adds debug logging for login client errors. |
| src/commands/cli-management/install.ts | Adds /dev/tty confirm prompt, changes shell integration flow, and improves install output. |
| scripts/install/install.sh | Sets APIFY_OPEN_TTY=1 when stdin isn’t a TTY so Node/Bun can open /dev/tty directly. |
| scripts/install/dev-test-install.sh | Adds a local dev script to test the installer flow (including `curl |
| scripts/build-cli-bundles.ts | Switches to Bun build() API, injects proxy-agent, and adjusts target lists/output generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #1027
Summary
curl | bash— shell-level</dev/ttyredirects don't support raw mode properly for Node.js/Inquirer, so we now setAPIFY_OPEN_TTY=1and let Node.js open/dev/ttyitself as a nativetty.ReadStream/dev/ttyprompt path (Inquirer's internal readline cannot be closed, which hangs the process), using a lightweight single-keypress reader with proper cleanupdev-test-install.shfor local testing of the install flowTest plan
cat scripts/install/dev-test-install.sh | bashand verify the Y/n prompt works (accepts single keypress, clears line with answer)apify installdirectly in a terminal and verify the normal Inquirer prompt still works🤖 Generated with Claude Code